<?php
 
 $num_post		= 5;
 $post_type		= 'slide-show';
 $orderby		= 'date'; 	 
 $order			= 'DESC'; 	
 $meta_key		= $wpdb->prefix.'display';
 $meta_value	= 'display';
 $myterm 		= $slide_show_on_page;
 $mytaxonomy	= 'show-on-page';
 $myfield		= 'slug';
 $args = db_query_all_post_in_post_type($num_post, $post_type, $orderby, $order, $meta_key, $meta_value);
 
 if(!isset($slide_show_on_page) || $slide_show_on_page=="")
 {
 	query_posts($args);	
 }
 else 
 {
 	$args1 = db_query_posts_in_terms_child_nopage($num_post, $post_type, $mytaxonomy, $myfield, $myterm, $meta_key, $meta_value);
 	query_posts($args1);
 	if(!have_posts())
 		query_posts($args);	
 }
 
?>
<div id="slideshowtop">				
			<ul class="rslides rslides2">
				  <?php include TEMPLATEPATH.'/views/loop-slide-show.php';?>               
				  <?php wp_reset_query();?>
			</ul>					
	</div>